package Week4.J0506;

import java.util.Scanner;

public class 小易的升级之路 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long x = scanner.nextLong();
        long[] arr = new long[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
            if (arr[i] <= x) {
                x += arr[i];
            }else {
                x += gcd(x, arr[i]);
            }
        }

        System.out.println(x);
    }

    private static long gcd(long x, long i) {
        if (i == 0) return x;
        else return gcd(i, x % i);
    }
}
